API - CoTemplate\Cotpl_block
system\cotemplate.php at line 578

Class Cotpl_block

Cotpl_block
All Known Subclasses:
Cotpl_logical Cotpl_loop

public class Cotpl_block

CoTemplate block class

Field Summary
array Contained blocks

$blocks

protected array Parsed block instances

$data

Constructor Summary
void

__construct(string code, array index, array path)

Block constructor

Method Summary
string

__toString()

TPL code representation for debugging

protected string

blocks_toString(array blocks)

Generates string representation for given set of blocks

protected void

compile(string code, array blocks, array index, array path)

Compiles TPL text into CoTemplate objects

array

getTags()

Returns the list of tag names present in the block

void

parse(XTemplate tpl)

Parses block contents

void

reset(mixed path)

Clears parsed block data

string

text(XTemplate tpl)

Returns parsed block HTML

Field Detail

system\cotemplate.php at line 587

blocks

public array Contained blocks $blocks = array()

system\cotemplate.php at line 583

data

protected array Parsed block instances $data = array()

Constructor Detail

system\cotemplate.php at line 596

__construct

public void __construct(string code, array index, array path)
Block constructor
Parameters:
code - TPL contents
index - Reference to CoTemplate index being built
path - Path to current block

Method Detail

system\cotemplate.php at line 606

__toString

public string __toString()
TPL code representation for debugging
Returns:

system\cotemplate.php at line 617

blocks_toString

protected string blocks_toString(array blocks)
Generates string representation for given set of blocks
Parameters:
blocks - Cotpl block objects (logical and data too)
Returns:

system\cotemplate.php at line 642

compile

protected void compile(string code, array blocks, array index, array path)
Compiles TPL text into CoTemplate objects
Parameters:
code - TPL source
blocks - Array of Ctpl_block/Ctpl_data objects
index - CoTemplate index
path - Current path

system\cotemplate.php at line 814

getTags

public array getTags()
Returns the list of tag names present in the block
Returns:

system\cotemplate.php at line 832

parse

public void parse(XTemplate tpl)
Parses block contents
Parameters:
tpl - Reference to XTemplate object

system\cotemplate.php at line 844

reset

public void reset(mixed path)
Clears parsed block data

system\cotemplate.php at line 855

text

public string text(XTemplate tpl)
Returns parsed block HTML
Parameters:
tpl - XTemplate object reference
Returns: